@import (reference) 'config';
@import (reference) 'icons';

w-select {
  display: block;

  &.tiny {
    height: @height-control-tiny;
  }

  &.small {
    height: @height-control-small;
  }

  &.big {
    height: @height-control-big;
  }

  &.select__no-user-select {
    user-select: none;
  }

  @media screen and (max-width: 768px) {
    &.big {
      height: @height-control-big-responsive;
    }
  }

  &.one-item .select .title {
    cursor: default;
    &::after {
      background-image: none;
    }
    w-avatar .avatar-wrap {
      cursor: default;
    }
  }

  &.hide-active .select .select-list w-option.active {
    display: none;
  }

  .select {
    height: 100%;
    position: relative;

    .title {
      position: relative;
      border: 1px solid @color-basic-200;
      height: 100%;
      background: @color-white;
      font-size: @font-size-control-small;
      padding: 0 35px 0 15px;
      border-radius: @border-radius;
      cursor: pointer;
      color: @color-disabled-900;

      .title-content {
        height: 100%;
        display: flex;
        align-items: center;
        width: 100%;
      }

      &::after {
        content: '';
        display: block;
        position: absolute;
        right: 16px;
        top: 50%;
        width: 12px;
        height: 12px;
        transform: translateY(-50%);
        background-size: 100%;
        background-image: @dex-arrow-down-icon;
      }
    }

    &.expanded .title {
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;

      &::after {
        background-image: @dex-arrow-down-blue-icon;
      }
    }

    .select-list {
      display: none;
      position: absolute;
      border: 1px solid @color-basic-200;
      border-top: none;
      border-radius: 0 0 @border-radius @border-radius;
      width: 100%;
      background-color: @color-white;
      z-index: 10;
      overflow: hidden;
      flex-direction: column;
      box-shadow: @shadow-main-default;

      w-option {
        position: relative;

        &.active {
          background-color: @color-basic-50;
        }
      }

      .option {
        cursor: pointer;
        padding: 8px 35px 8px 15px;
        white-space: nowrap;
        color: @color-disabled-900;
        display: flex;
        align-items: center;
        &:hover {
          background-color: @color-basic-50;
        }
      }
    }

    &.to-up {
      .select-list {
        border: 1px solid @color-basic-100;
        border-bottom: none;
      }
    }

    &[disabled] .title,
    &.disabled .title {
      background: @color-basic-50;
      cursor: default;
    }
  }

  &.interface {
    height: 42px;

    .title {
      background: @color-white;
      border-color: @color-white;
      color: @color-basic-700;
      box-shadow: @shadow-buttons-default;
      width: 100%;
      font-size: 15px;
    }

    &:hover {
      border-radius: @border-radius @border-radius 0 0;
      color: @color-basic-700;

      .title {
        box-shadow: @shadow-buttons-hover;
        transition: all 0.3s;
        color: @color-basic-700;
      }

      .select:not(.expanded) {
        border-radius: 0 0 @border-radius @border-radius;
      }
    }

    .select.expanded {
      .title {
        border-top: 1px solid @color-basic-200;
        border-left: 1px solid @color-basic-200;
        border-right: 1px solid @color-basic-200;
        border-bottom: 1px solid @color-white;
        border-radius: @border-radius @border-radius 0 0;
      }
    }

    &[disabled],
    &.disabled {
      &:hover {
        .select .title {
          box-shadow: @shadow-buttons-default; //@color-basic-50;
          color: @color-basic-500;
        }
      }
    }
  }
}
